from app.services.business.gaolu_diagnose.ind.abstract_ind import AbstractInd


class CG_LT_GL_GL04_RLB(AbstractInd):

    def get_name(self):
        return "CG_LT_GL_GL04_RLB"

    def get_data_source(self):
        return "mysql"

    def get_sql(self, params) -> str:
        sql_RLB = """ 
                SELECT
                syn_tq_rshangliaoqk.fcokerate + syn_tq_rshangliaoqk.fcoalrate AS CG_LT_GL_GL04_RLB,
                syn_tq_rshangliaoqk.fdatetime
                FROM
                syn_tq_rshangliaoqk
                WHERE syn_tq_rshangliaoqk.fcokerate NOT LIKE '%#%'
                AND syn_tq_rshangliaoqk.fcoalrate NOT LIKE '%#%'
                and syn_tq_rshangliaoqk.fdatetime > DATE_SUB(CURTIME(), INTERVAL 2 hour)    		

                       """.format(**params)
        return sql_RLB
